import request from '@/utils/request'

/**
 *  获取参数列表
 */
export function getParameterList(id, sel) {
  return request({
    url: '/categories/' + id + '/attributes',
    params: {
      sel
    }
  })
}

/**
 * 添加商品属性
 * @param {*} id 分类id
 * @param {*} attrName 参数名称
 */
export function addParameter(id, attrName) {
  return request({
    url: '/categories/' + id + '/attributes',
    method: 'POST',
    data: {
      attr_name: attrName,
      attr_sel: 'only'
    }
  })
}
